package personal.xjl._23java1studentdemo.spring;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component()
@Data@NoArgsConstructor@AllArgsConstructor
public class CowCart {
    @Autowired
    Cow cow;
    @Value("3")
    int wheelCount;

    public void run(){
        System.out.println("一辆由 " + cow.getName() + " 拉着的 " + wheelCount + " 轮牛车正在行驶...");
    }

}
